package com.vast.metrix.recorder.bustraffic.preferences;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import com.vast.metrix.recorder.bustraffic.Activator;
import com.vast.metrix.recorder.bustraffic.preferences.PreferenceConstants;

public class PreferencePage extends FieldEditorPreferencePage 
implements IWorkbenchPreferencePage {

public PreferencePage() {
	// TODO Auto-generated constructor stub
	super(GRID);
	setPreferenceStore(Activator.getDefault().getPreferenceStore());
	setDescription("Slider Panel Preferences");
}

public void init(IWorkbench workbench) {
	// TODO Auto-generated method stub

}

protected void createFieldEditors() {
	// TODO Auto-generated method stub
	addField(new IntegerFieldEditor(PreferenceConstants.P_SOCKET_PORTNUMBER, 
			"Port Number for Socket :", getFieldEditorParent()));
	addField(new IntegerFieldEditor(PreferenceConstants.P_REFRESH_RATE_MS, 
			"Refresh Rate [ms] to draw the graph(Integer) :", getFieldEditorParent()));
	addField(new IntegerFieldEditor(PreferenceConstants.P_MAXIMUM_X_TIMERANGE_MS, 
			"Maximum history range of XAixs [ms] to draw the graph(Integer) :", getFieldEditorParent()));

	addField(new RadioGroupFieldEditor(
			PreferenceConstants.P_WAIT_VALUE,
				"Wait of Recv Thread",
				1,
				new String[][] { 
					{"Resonable (Recommend)", "5" },
					{"Tight", "2" },
					{"Very Tight", "1" },
					{"None ", "0" }
				}, getFieldEditorParent()));
}
}
